package com.blog.controller;

import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.blog.dao.TestDAO;
import com.blog.domain.IbatisTest;
import com.blog.service.TestService;

@Controller
public class GalleryController {

	@Autowired
	TestDAO service;

	@RequestMapping("/gallery")
	public String test(HttpServletRequest request, HttpServletResponse response, ModelMap model){
		IbatisTest dto = new IbatisTest();
		dto.setmId("id");
		dto.setmPwd("pwd123");
		dto.setmCode(service.selectMCodeMax());
		
		service.insertAll(dto);
		
		List<String> list = service.selectAll();
		model.addAttribute("model", list);
		return "body/blog/gallery";
	}
}
